package com.wandian.news.mvvm.knowledge.scjs;

import android.os.Bundle;

import androidx.databinding.DataBindingUtil;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mylib.libcore.config.RouterConfig;
import com.mylib.libcore.mvvm.BaseMVVMActivity;
import com.mylib.libcore.utils.ActivityUtil;
import com.mylib.libcore.utils.FileUtil;
import com.mylib.libcore.utils.ImageUtil;
import com.wandian.news.R;
import com.wandian.news.databinding.NewsActivityKnowledgeScjsBinding;
import com.wandian.news.databinding.NewsActivityLifeNlBinding;

/**
 * @author Administrator
 * @date 2019/12/18-14:28
 * @description 诗词鉴赏activity
 **/
@Route(path = RouterConfig.ROUTER_ACTIVITY_NEWS_SCJS)
public class KnowledgeSCJSActivity extends BaseMVVMActivity<KnowledgeSCJSViewModel>   {
    private NewsActivityKnowledgeScjsBinding dataBinding;

    @Override
    public void init(Bundle savedInstanceState) {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.news_activity_knowledge_scjs);
        dataBinding.setLifecycleOwner(this);
        dataBinding.setViewModel(mViewModel);
        initViewData();
        initClink();

    }



    private void initViewData(){
        ActivityUtil.getInstance().showStatusView(this,dataBinding.viewSysTop,true);
        dataBinding.bindTransparentToolBar.toolBarTvTitle.setText("诗词鉴赏");

    }


    private void initClink(){
        dataBinding.bindTransparentToolBar.toolBarIvBack.setOnClickListener(v -> finish());

        dataBinding.tv1.setOnClickListener(v -> getOtherData("元曲"));
        dataBinding.tv2.setOnClickListener(v -> getOtherData("唐诗"));
        dataBinding.tv3.setOnClickListener(v -> getOtherData("精选宋词"));
        dataBinding.tv4.setOnClickListener(v -> getOtherData("优美诗句"));
        dataBinding.tv5.setOnClickListener(v -> getOtherData("唐诗大全"));
    }

    private void getOtherData(String title){
        ARouter.getInstance().build(RouterConfig.ROUTER_ACTIVITY_NEWS_SCJS_OTHER).withString("title",title).navigation();
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
    }


}
